<template>
    <div class="login" >
      <el-form >
        <p>登录</p>
        <p> 欢迎使用托管信息系统</p>
        <p> 用户名</p>
        <el-input v-model="user" placeholder="用户名"></el-input>
        <p> 密码</p>
        <el-input placeholder="密码" v-model="pass" show-password></el-input>
        <div class="cli">
          <el-button type="primary" plain @click="toHome">登录</el-button>
        </div>
      </el-form>
    </div>
</template>

<script>
import router from "../router";
import {ref} from "vue";

export default {
  name: "LoginVIew",
  setup() {
    let user = ref("");
    let pass = ref("");
    let toHome=()=> {
      if (user.value==="1234" && pass.value==="1234") {
        router.push({path: "/home"})
      }
    };
    return {
      user, pass, toHome
    }
  },
}
</script>

<style>
.login {
  width: 300px;
  border-radius: 10px;
  margin: 200px 400px auto;
  border: 1px solid;
}

.cli {
  margin: 3px;
}

.showself {
  border: 1px solid;
}

</style>
